package com.wgb.movie.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wgb.movie.model.dto.theater.TheaterQueryRequest;
import com.wgb.movie.model.entity.Theater;
import com.wgb.movie.model.vo.TheaterVO;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletRequest;

/**
 * 影院服务
 *
 * @author <a href="https://github.com/liyupi">程序员鱼皮</a>
 * @from <a href="https://www.code-nav.cn">编程导航学习圈</a>
 */
public interface TheaterService extends IService<Theater> {

    /**
     * 校验数据
     *
     * @param theater
     * @param add 对创建的数据进行校验
     */
    void validTheater(Theater theater, boolean add);

    /**
     * 获取查询条件
     *
     * @param theaterQueryRequest
     * @return
     */
    QueryWrapper<Theater> getQueryWrapper(TheaterQueryRequest theaterQueryRequest);
    
    /**
     * 获取影院封装
     *
     * @param theater
     * @param request
     * @return
     */
    TheaterVO getTheaterVO(Theater theater, HttpServletRequest request);

    /**
     * 分页获取影院封装
     *
     * @param theaterPage
     * @param request
     * @return
     */
    Page<TheaterVO> getTheaterVOPage(Page<Theater> theaterPage, HttpServletRequest request);

//    @Transactional
//    boolean removeByIdT(long id);
}
